Only change mine data if using new allow_tgt feature #56172
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
With the new
allow_tgt
feature in the mine.get the data structure was changed. This PR ensures we only send this new data structure if we are using the newallow_tgt
feature.Fixes the issue in #56118
The initial issue made it so a master on <3000 would not work with a >=3000 minion with mine data. With this PR we only change the data structure if we are using the new feature, so we assume if they are using the new feature they want to use 3000. Also documented that both the master and minion need to be on atleast versions 3000 if using this feature.
This PR also fixes another issue I found. If you set a minion in
allow_tgt
that is a minion that does not actually exist it will return the data regardless. Without this PR given the following config:As you can see above we have defined a minion that does not exist in
allow_tgt
, but I can still gather the data for any minion:With this patch, we check to see if the minion even exists, if it does not we do not allow the minion to view the data:
What issues does this PR fix or reference?
Fixes #56118
Previous Behavior
Data returned on a master (<3000) and minion (>=3000), even if not using the new
allow_tgt
feature:New Behavior
Data returned on a master (<3000) and minion (>=3000), even if not using the new
allow_tgt
feature:To note if one is using the
allow_tgt
feature and they have a master <3000 they will see the wrong data (ex,__data__
), this feature requires both master and minion are upgraded.Tests written?
Yes
Commits signed with GPG?
Yes